﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Data;

namespace DAO
{
    public class DB
    {
        /// <summary>
        /// 数据库连接字符串
        /// </summary>
        public static String DB_CONN_STR = @"Data Source=115.28.137.89;Initial Catalog=DB_BaiduHi;User ID=sa;Password=ysh198811";
        /// <summary>
        /// 全局共享数据库连接对象
        /// </summary>
        public static SqlConnection DB_CONN = new SqlConnection(DB.DB_CONN_STR);

        /// <summary>
        ///     关闭数据库连接
        /// </summary>
        public static void CloseDB()
        {
            if (DB_CONN.State == ConnectionState.Open)
            {
                DB_CONN.Close();
            }
        }
    }
}
